package com.kingschan.jeasytag.sql.query;

import com.kingschan.jeasytag.container.EasyTagContainer;
import com.kingschan.jeasytag.container.impl.EasyTagContainerImpl;
import com.kingschan.jeasytag.enums.DbType;

/**
 * QueryFactory
 * @author kingschan
 *date:2013-4-17
 */
public class QueryFactory {
/**
 * getQuery
 * @param db_type
 * @return
 * @throws Exception
 */
	 
	public static Query getQuery(DbType db_type)throws Exception{
		Query query = null;
		EasyTagContainer container = EasyTagContainerImpl.getInstance();
		switch (db_type) {
		case MYSQL:
			query=container.getMysqlQuery();
			break;
		case SQLSERVER:
			query=container.getSqlServerQuery();
			break;
		case ORACLE:
			query=container.getOracleQuery();
			break;
		default:			
			break;
		}
		return query;
	}
}
